home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 517 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.9 KB

  1. Date: Wed, 29 Sep 93 23:31:38 GMT
  2. Message-Id: <984@falcon.demon.co.uk>
  3. From: alex@falcon.demon.co.uk (Alex Kiernan)
  4. To: mint@terminator.rs.itd.umich.edu
  5. Subject: Memory violation: free
  6. Lines: 85
  7.  
  8. I've been having a lot of problems with some apps with the above memory
  9. violation. I finally got around to tracking it down today & it happens
  10. with apps which call the OS with less than 1K of supervisor stack free
  11. in the current page. 64 bytes seems a lot more reasonable than 1K to
  12. me since 64 bytes is around the size of the largest stack frame which
  13. the processor can generate. Whilst I was about it I fixed up a couple
  14. of other new problems I'd never encountered, but obviously could happen
  15. (wrong number of loop iterations).
  16.  
  17. *** m:/context.spp  Tue Jul 27 19:44:42 1993
  18. --- context.spp Wed Sep 29 14:50:38 1993
  19. ***************
  20. *** 104,109 ****
  21. --- 104,110 ----
  22.     lea _framesizes,a3
  23.     move.b  0(a3,d1.w),d1
  24.     beq.s   short1      ; if no data to save, skip this
  25. +   subq.w  #1,d1       ; correct for first time through loop
  26.   bcint:    move.w  (a1)+,(a2)+ ; copy CPU internal state
  27.   bcover:   dbf d1,bcint
  28.   short1:
  29. ***************
  30. *** 174,180 ****
  31.   
  32.     move.l  C_SSP(a0),a1    ; get supervisor stack pointer
  33.     tst.b   (a1)        ; touch the page for virtual memory programs
  34. !   tst.b   -1023(a1)   ; make sure stack can grow
  35.     move.l  a1,sp
  36.     move.l  C_USP(a0),a1
  37.     move.l  a1,usp      ; set user stack pointer
  38. --- 175,181 ----
  39.   
  40.     move.l  C_SSP(a0),a1    ; get supervisor stack pointer
  41.     tst.b   (a1)        ; touch the page for virtual memory programs
  42. !   tst.b   -63(a1)     ; make sure stack can grow
  43.     move.l  a1,sp
  44.     move.l  C_USP(a0),a1
  45.     move.l  a1,usp      ; set user stack pointer
  46. ***************
  47. *** 206,212 ****
  48.     sub.w   d1,sp
  49.     sub.w   d1,sp
  50.     move.l  sp,a2
  51. !   bra.s   rcover
  52.   rcint:    move.w  (a1)+,(a2)+
  53.   rcover:   dbf d1,rcint
  54.   rcovernc:
  55. --- 207,213 ----
  56.     sub.w   d1,sp
  57.     sub.w   d1,sp
  58.     move.l  sp,a2
  59. !   subq.w  #1,d1       ; correct for first time through loop
  60.   rcint:    move.w  (a1)+,(a2)+
  61.   rcover:   dbf d1,rcint
  62.   rcovernc:
  63. ***************
  64. *** 241,247 ****
  65.   
  66.     move.l  C_SSP(a0),a1    ; get supervisor stack pointer
  67.     tst.b   (a1)        ; touch the page for virtual memory programs
  68. !   tst.b   -1023(a1)   ; make sure stack can grow
  69.     move.l  a1,sp
  70.     move.l  C_USP(a0),a1
  71.     move.l  a1,usp      ; set user stack pointer
  72. --- 242,248 ----
  73.   
  74.     move.l  C_SSP(a0),a1    ; get supervisor stack pointer
  75.     tst.b   (a1)        ; touch the page for virtual memory programs
  76. !   tst.b   -63(a1)     ; make sure stack can grow
  77.     move.l  a1,sp
  78.     move.l  C_USP(a0),a1
  79.     move.l  a1,usp      ; set user stack pointer
  80. ***************
  81. *** 270,275 ****
  82. --- 271,277 ----
  83.     sub.w   d1,sp
  84.     sub.w   d1,sp
  85.     move.l  sp,a2
  86. +   subq.w  #1,d1       ; correct for first time through loop
  87.   rcint2:   move.w  (a1)+,(a2)+
  88.   rcover2: dbf  d1,rcint2
  89.   rcover2nc:
  90. --
  91. Alex Kiernan.
  92. alex@falcon.demon.co.uk
  93.